import { findHeadCategory } from '@/api/home'
export default {
  namespaced: true,
  state () {
    return {
      // 头部菜单
      navs: []
    }
  },
  mutations: {
    updateNavs (state, navs) {
      state.navs = navs
    }
  },
  actions: {
    async getHeadNavs ({ commit }) {
      const { result } = await findHeadCategory()
      // console.log(result)
      commit('updateNavs', result)
    }
  }
}
